package homework;

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		Fraction a = new Fraction(in.nextInt(), in.nextInt());
		Fraction b = new Fraction(in.nextInt(),in.nextInt());
		a.print();
		b.print();
		a.plus(b).print();
		a.multiply(b).plus(new Fraction(5,6)).print();
		a.print();
		b.print();
		in.close();
	}
	
	
	static class  Fraction {
		private int numerator;
		private int denominator;
		
		public Fraction(int a,int b){
			this.numerator=a;
			this.denominator=b;
		}
		
		public double toDouble(){
			return (double)(numerator/denominator);
		}
		
		public Fraction plus(Fraction r){
			//2/3+3/5
			Fraction fraction=new Fraction(0,1);
			if(denominator==r.denominator){
				fraction.numerator=numerator+r.numerator;
				fraction.denominator=r.denominator;
			}else{
				fraction.numerator=numerator*r.denominator+denominator*r.numerator;
				fraction.denominator=denominator*r.denominator;
				
			}
			
			return fraction;
		}
		
		
		public Fraction multiply(Fraction r){
			//2/3*3/5
			Fraction fraction=new Fraction(0,1);
			fraction.numerator=numerator*r.numerator;
			fraction.denominator=denominator*r.denominator;
			
			return fraction;
		}
		
		public void print() {
			int r;
			int x = numerator;
			int y = denominator;

			if (numerator == denominator || numerator == 0) {
				System.out.println(numerator / denominator);
			} else {
				while (x != 0) {
					r = y % x;
					y = x;
					x = r;
				}
				numerator /= y;
				denominator /= y;
				System.out.println(numerator + "/" + denominator);
			}
		}
	}
}
